import userMgr from '@/biz/user'
import biApi from '@/config/server/api/bi.js'
import userApi from '@/config/server/api/user.js'

function callRecordList(info) {
  return biApi.callRecord.callRecordList.fetch(info)
}

function outCallRecordList(info) {
  return biApi.callRecord.outCallRecordList.fetch(info)
}

function callRecordListExport(info) {
  return biApi.callRecord.callRecordListExport.fetch(info)
}
function outCallRecordExport(info) {
  return biApi.callRecord.outCallRecordExport.fetch(info)
}

function getCityDictionaries(info) {
  return userApi.receiver.getCityDictionaries.fetch(info)
}

function getPhoneByCity(info) {
  return userApi.receiver.getPhoneByCity.fetch(info)
}

function getTeamUserByRole(info) {
  return userApi.receiver.getTeamUserByRole.fetch(info)
}

function receiverSaveOrUpdate(info) {
  info.createId = userMgr.info().userId
  info.updateId = userMgr.info().userId
  return userApi.receiver.receiverSaveOrUpdate.fetch(info)
}

function getReceiverInfoByBId(info) {
  return userApi.receiver.getReceiverInfoByBId.fetch(info)
}

function removeBuildingAndAdviser(info) {
  info.operatorId = userMgr.info().userId
  return userApi.receiver.removeBuildingAndAdviser.fetch(info)
}

function usReceiverList(info) {
  return biApi.receiver.usReceiverList.fetch(info)
}

function usReceiverDetails(info) {
  return biApi.receiver.usReceiverDetails.fetch(info)
}

function usReceiverExport(info) {
  return biApi.receiver.usReceiverExport.fetch(info)
}

function receiverDel(info) {
  return userApi.receiver.receiverDel.fetch(info)
}

// 外呼号
function getByWorkNoOrName(info) {
  return userApi.teams.getByWorkNoOrName.fetch(info)
}

function usPrivacyNumberManage(info) {
  return biApi.receiver.usPrivacyNumberManage.fetch(info)
}

function usPrivacyNumberManageStatistics(info) {
  return biApi.receiver.usPrivacyNumberManageStatistics.fetch(info)
}

function usPrivacyNumberManageExport(info) {
  return biApi.receiver.usPrivacyNumberManageExport.fetch(info)
}

function useLogList(info) {
  return userApi.receiver.useLogList.fetch(info)
}

function getPrivacyNumUseList(info) {
  return userApi.receiver.getPrivacyNumUseList.fetch(info)
}

function toBuyPrivacyNumberPackage(info) {
  return userApi.receiver.toBuyPrivacyNumberPackage.fetch(info)
}

function privacyNumberPackage(info) {
  return userApi.receiver.privacyNumberPackage.fetch(info)
}

function getCanBuyPhone(info) {
  return userApi.receiver.getCanBuyPhone.fetch(info)
}

function getPrivacyNumberPackageList(info) {
  return userApi.receiver.getPrivacyNumberPackageList.fetch(info)
}

function exportPrivacyNumberPackageList(info) {
  return userApi.receiver.exportPrivacyNumberPackageList.fetch(info)
}

function getPrivacyNumberPackageLogList(info) {
  return userApi.receiver.getPrivacyNumberPackageLogList.fetch(info)
}

function coerceEnd(info) {
  return userApi.receiver.coerceEnd.fetch(info)
}

function exportPrivacyNumUseList(info) {
  return userApi.receiver.exportPrivacyNumUseList.fetch(info)
}

function queryOnDeletionLastOne(info) {
  return userApi.caseClueCustomer.queryOnDeletionLastOne.fetch(info)
}

export default {
  callRecordList,
  outCallRecordList,
  callRecordListExport,
  getCityDictionaries,
  getPhoneByCity,
  getTeamUserByRole,
  receiverSaveOrUpdate,
  getReceiverInfoByBId,
  removeBuildingAndAdviser,

  // 承接人列表
  usReceiverList,
  usReceiverDetails,
  usReceiverExport,
  receiverDel,
  queryOnDeletionLastOne,

  // 隐私号
  getByWorkNoOrName,
  usPrivacyNumberManage,
  usPrivacyNumberManageStatistics,
  usPrivacyNumberManageExport,
  useLogList,
  // 租用
  getPrivacyNumUseList,
  toBuyPrivacyNumberPackage,
  privacyNumberPackage,

  getCanBuyPhone,
  getPrivacyNumberPackageList,
  exportPrivacyNumberPackageList,
  getPrivacyNumberPackageLogList,
  coerceEnd,
  exportPrivacyNumUseList,
  outCallRecordExport
}
